{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading train-images-idx3-ubyte.gz ... \n",
      "Done\n",
      "Downloading train-labels-idx1-ubyte.gz ... \n",
      "Done\n",
      "Downloading t10k-images-idx3-ubyte.gz ... \n",
      "Done\n",
      "Downloading t10k-labels-idx1-ubyte.gz ... \n",
      "Done\n",
      "Converting train-images-idx3-ubyte.gz to NumPy Array ...\n",
      "Done\n",
      "Converting train-labels-idx1-ubyte.gz to NumPy Array ...\n",
      "Done\n",
      "Converting t10k-images-idx3-ubyte.gz to NumPy Array ...\n",
      "Done\n",
      "Converting t10k-labels-idx1-ubyte.gz to NumPy Array ...\n",
      "Done\n",
      "Creating pickle file ...\n",
      "Done!\n",
      "5\n",
      "(784,)\n",
      "(28, 28)\n"
     ]
    }
   ],
   "source": [
    "# minist_show\n",
    "import sys, os\n",
    "sys.path.append(os.pardir)  # 为了导入父目录的文件而进行的设定\n",
    "import numpy as np\n",
    "from dataset.mnist import load_mnist\n",
    "from PIL import Image\n",
    "\n",
    "\n",
    "def img_show(img):\n",
    "    pil_img = Image.fromarray(np.uint8(img))\n",
    "    pil_img.show()\n",
    "\n",
    "(x_train, t_train), (x_test, t_test) = load_mnist(flatten=True, normalize=False)\n",
    "\n",
    "img = x_train[0]\n",
    "label = t_train[0]\n",
    "print(label)  # 5\n",
    "\n",
    "print(img.shape)  # (784,)\n",
    "img = img.reshape(28, 28)  # 把图像的形状变为原来的尺寸\n",
    "print(img.shape)  # (28, 28)\n",
    "\n",
    "img_show(img)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 640x480 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNY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xck1IFBq/Xq7vuuktnn322Bg4caHYcv7NgwQKtW7dO3377rdlRfAJHRtqhadOmyWKx/OSSm5ur5557TpWVlZo+fbrZkX1WU1/rH9u3b58uvvhiXXPNNbr11ltNSg6cnilTpmjz5s1asGCB2VH8TmFhoaZOnap//vOfCgsLMzuOT2A6+HaotLRUBw8e/Mltunfvrl/+8pf64IMPZLFYGtd7PB4FBQXp+uuv16uvvtraUX1eU1/r0NBQSdL+/fs1evRojRw5Uq+88oqsVvr86XC73YqIiNBbb72l8ePHN66fNGmSDh8+rEWLFpkXzo/99re/1aJFi/TFF1+oW7duZsfxO++9955+/vOfKygoqHGdx+ORxWKR1WqVy+U66megjPi0goICORyOxu/379+vsWPH6q233lJmZqZSU1NNTOd/9u3bpzFjxmjYsGF6/fXXeTNpIZmZmRoxYoSee+45SQ2nD7p06aLf/va3mjZtmsnp/IthGLrzzjv17rvv6rPPPlOvXr3MjuSXKisr9f333x+1bvLkyerbt6/uvfdeTosdB2NGfFiXLl2O+j4qKkqS1KNHD4pIC9u3b59Gjx6trl276qmnnlJpaWnjz5KSkkxM5vuys7M1adIkDR8+XCNGjNDs2bPldDo1efJks6P5nSlTpmj+/PlatGiRoqOjVVRUJEmy2+0KDw83OZ3/iI6OPqZwREZGqmPHjhSRE6CMAE2wbNky5eXlKS8v75iix8HF0zNhwgSVlpZq5syZKioq0pAhQ7R06dJjBrXi9P31r3+VJI0ePfqo9X//+9914403tn0g4AhO0wAAAFMx+g4AAJiKMgIAAExFGQEAAKaijAAAAFNRRgAAgKkoIwAAwFSUEQAAYCrKCAAAMBVlBAAAmIoyAgAATEUZAQAApqKMAAAAU/1/4NE+XVk154gAAAAASUVORK5CYII=\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# sigmod\n",
    "import numpy as np\n",
    "import matplotlib.pylab as plt\n",
    "\n",
    "\n",
    "def sigmoid(x):\n",
    "    return 1 / (1 + np.exp(-x))\n",
    "\n",
    "X = np.arange(-5.0, 5.0, 0.1)\n",
    "Y = sigmoid(X)\n",
    "plt.plot(X, Y)\n",
    "plt.ylim(-0.1, 1.1)\n",
    "plt.show()\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}